package mn.slide.labmed.info;

import mn.slide.labmed.R;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ViewFlipper;

public class InfoActivity extends Activity
{
	Button						benutzbtn , uberbtn , kontaktbtn , impressbtn;
	public static ViewFlipper	flipper;

	@Override
	public void onCreate( Bundle savedInstanceState )
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.info);
		Button har = (Button) findViewById(R.id.button1);
		har.setVisibility(View.INVISIBLE);
		EditText searchbox = (EditText) findViewById(R.id.info_search);
		searchbox.setOnKeyListener(new View.OnKeyListener()
		{

			public boolean onKey( View v , int keyCode , KeyEvent event )
			{
				if (keyCode == KeyEvent.KEYCODE_ENTER)
				{
					EditText searchbox = (EditText) v;

					InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
					imm.hideSoftInputFromWindow(searchbox.getWindowToken(), 0);
					InfoTabGroupActivity.group.goSearchActivity(searchbox.getText().toString());
				}
				return false;
			}
		});
		benutzbtn = (Button) findViewById(R.id.benutsbtn);
		benutzbtn.setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				InfoTabGroupActivity.group.goNewsList(1);

			}
		});
		kontaktbtn = (Button) findViewById(R.id.kontaktbtn);
		kontaktbtn.setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				InfoTabGroupActivity.group.goNewsList(3);

			}
		});
		uberbtn = (Button) findViewById(R.id.uberbtn);
		uberbtn.setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				InfoTabGroupActivity.group.goNewsList(2);

			}
		});
		impressbtn = (Button) findViewById(R.id.impressumbtn);
		impressbtn.setOnClickListener(new View.OnClickListener()
		{

			public void onClick( View v )
			{
				InfoTabGroupActivity.group.goNewsList(4);

			}
		});
	}
}
